<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"/>
	<title>demo</title>
	<meta name="keywords" content=""/>
	<meta name="description" content=""/>
	<meta name="viewport" content="width=device-width"/>
</head>
<body>
	<img src="" alt="">
	<script>

		var arr = Array(
			'../img/1.jpg',
			'../img/2.jpg',
			'../img/3.jpg',
			'../img/4.jpg',
			'../img/5.jpg',
			'../img/6.jpg',
			'../img/7.jpg',
			'../img/8.jpg',
			'../img/9.jpg',
			'../img/10.jpg'
		);
		var Num = Math.floor(Math.random()*10);
		var i = document.getElementsByTagName('img');
		i[0].src = arr[Num];
		console.log(i);

	</script>
</body>
</html>